-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue 2512] S3 Presign URL #2563
Conversation
api/tests/lib/opportunity_attachment_test_files/test_file_2.txt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, tested it locally, just a few tidying up suggestions
if s3_config.s3_endpoint_url: | ||
pre_sign_file_loc = pre_sign_file_loc.replace( | ||
s3_config.s3_endpoint_url, "http://localhost:4566" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest we add a comment calling out this hacky fix as only mattering locally due to docker path issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should i mark it as todo as well ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Summary
Fixes #{2512}
Time to review: 20 mins
Changes proposed
Added test files for opportunity attachment
Updated local seed db with func to upload test files to S3
Updated factories to set opportunity attachment "file_location" from any value in static list
Updated the response schema to return new field
download_path
which is the link to the pre-signed urlAdded default Expiration limit for the s3 url in s3 config
Added reusable function to get aws boto3 session for local development
Added new env variable for local development
Added fixture to upload test files
Added unit test. Tests if we can successfully download s3 file.
Context for reviewers
Return a pre-signed url for an attachment a user can then use to download the s3 file
Additional information